<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DelMessageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('message');

        //消息
        Schema::create('message', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('title')->nullable()->comment('标题');
            $table->string('content')->nullable()->comment('评论内容');
            $table->integer('demand_id')->default(0)->comment('需求id');
            $table->integer('activity_id')->default(0)->comment('活动id');
            $table->integer('img_id')->default(0)->comment('消息图片');
            $table->integer('to_user_id')->default(0)->comment('收到消息的用户');
            $table->text('detail')->nullable()->comment('详情');
            $table->string('type')->nullable()->comment('类型 demand：需求消息 activity：活动消息 system：系统消息');
            $table->integer('is_read')->default(0)->comment('是否已查看');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
